<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var num = 10;
        function fn(a) {
            a = 20;
            sum = 30;// 全局变量
            console.log(a);
        }
        fn(num);
        // console.log(a);
        console.log(sum);
    </script>
</head>

<body>

</body>

</html>